import React from 'react'
import { MyContext } from '../../context'
import { NavLink } from 'react-router-dom'
const Index = () => {

    return (
        <div>
            <NavLink to="/">去首页</NavLink>
            <MyContext.Consumer>
                {
                    ({ carList }) => {
                        return <ul>
                            {
                                carList.map((v, i) => {
                                    return <li key={i}>{v}</li>
                                })
                            }
                        </ul>
                    }

                }
            </MyContext.Consumer>
        </div>
    )
}

export default Index